package com.example.controller;

import com.example.service.Cal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cal")
public class CalController {
    @Autowired
    private Cal cal;

    @PostMapping("/add")
    public int add(@RequestParam int num1, @RequestParam int num2){
        return cal.add(num1, num2);
    }
}
